Skip to content

New pattern - bedrock-agent-openai-cdk#3084

Open
NithinChandranR-AWS wants to merge 6 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-bedrock-agent-openai-cdk
Open

New pattern - bedrock-agent-openai-cdk#3084
NithinChandranR-AWS wants to merge 6 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-bedrock-agent-openai-cdk

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown
Contributor

Description

Deploy an Amazon Bedrock Agent powered by OpenAI GPT OSS (gpt-oss-20b) with a Lambda action group for tool use.

Changes

  • lib/bedrock-agent-openai-stack.ts — CDK stack: Bedrock Agent + OpenAI foundation model + Lambda action group with OpenAPI schema
  • src/index.js — Lambda handler with input validation and error sanitization
  • README.md — Architecture, deployment steps, and testing instructions
  • example-pattern.json — Pattern metadata with services field

Testing

  • cdk synth — clean, 7 resources
  • Deployed to AWS account, tested single-tool and multi-tool agent queries
  • Input validation: 100-char limit, regex sanitization, required field checks
  • IAM: least-privilege, scoped to specific model ARN

… pattern

Deploy an Amazon Bedrock Agent powered by OpenAI GPT OSS model with
a Lambda action group for tool use (weather + time). First pattern
combining Bedrock Agents with OpenAI models on Bedrock.
@NithinChandranR-AWS
Copy link
Copy Markdown
Contributor Author

Hi @biswanathmukherjee 👋 Friendly nudge — this pattern is ready for review. Deployed and tested end-to-end on a live AWS account. Would appreciate a look when you have time. Thank you!

The InvokeAgent API returns a streaming response that the AWS CLI
does not support. Replaced with Python SDK snippet that correctly
handles the event stream.
@NithinChandranR-AWS
Copy link
Copy Markdown
Contributor Author

Hi @biswanathmukherjee 👋 This is the first pattern using OpenAI models on Bedrock — a unique integration showing Bedrock Agents with the new OpenAI GPT OSS foundation model. No existing pattern covers this model provider. Deployed and tested.

Copy link
Copy Markdown
Contributor

@ellisms ellisms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting minor changes.

* [AWS CDK v2](https://docs.aws.amazon.com/cdk/v2/guide/getting-started.html) installed
* [Amazon Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) enabled for OpenAI GPT OSS 20B in your target region

## Architecture
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert this to an image, rather than ASCII.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0759a62. Thank you!

Comment thread bedrock-agent-openai-cdk/README.md Outdated
@@ -0,0 +1,129 @@
# Amazon Bedrock Agent with OpenAI model

This pattern deploys an Amazon Bedrock Agent powered by an OpenAI GPT OSS foundation model with a Lambda action group that provides tool-use capabilities.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This pattern deploys an Amazon Bedrock Agent powered by an OpenAI GPT OSS foundation model with a Lambda action group that provides tool-use capabilities.
This pattern deploys an Amazon Bedrock Agent powered by an OpenAI GPT OSS foundation model with an AWS Lambda action group that provides tool-use capabilities.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0759a62. Thank you!

- Update description to use full 'AWS Lambda' service name
- Replace ASCII architecture diagram with PNG image
- Add figure caption for accessibility
Generated using diagrams library with official AWS icons (Bedrock,
Lambda, User). Professional quality for Serverless Land.
@NithinChandranR-AWS
Copy link
Copy Markdown
Contributor Author

Architecture diagram preview (generated with diagrams library using official AWS icons):

architecture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants